<!doctype html>

<!--
  ~ License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
  -->

<html>

<head>
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Demo of Firefly Tools</title>
</head>

<body>

<div id="fireflyLostConnWarn" data-decor="small" class="warning-div right"></div>

<div style="width: 500px; padding: 50px 0 0 20px;">
    <br>
    This page demos new api
    <br>
</div>

<div>
    <div id="coverageHere" style="display: inline-block; width: 400px; height: 400px; margin: 10px;"></div>
    <div id="tables-1" style="display: inline-block; width: 550px; height: 300px; margin: 10px; background-color: white;"></div>
</div>

<script type="text/javascript">
    {

        window.firefly= {};
        onFireflyLoaded= function(firefly) {

            window.ffViewer= firefly.getViewer();

            firefly.setGlobalImageDef({
                ZoomType  : 'TO_WIDTH'
            } );

            firefly.debug= true;
            firefly.options= {
                hips : {useForImageSearch: true, hipsSources: 'all', defHipsSources: {source: 'irsa', label: 'IRSA'},
            }};

            var util= firefly.util;
            var ui= firefly.ui;






            //-----------------  TABLE DEMO ------------------------//
            tblReq1 = firefly.util.table.makeIrsaCatalogRequest('allwise_p3as_psd', 'WISE', 'allwise_p3as_psd',
                    {   position: '148.9;68.8;EQ_J2000',
                        SearchMethod: 'Cone',
                        radius: 300,
                    },
                    {tbl_id: 'aTable'}
                    );
            tblReq2 = firefly.util.table.makeIrsaCatalogRequest('fp_psc', '2MASS', 'fp_psc',
                    {   position: '148.9;68.8;EQ_J2000',
                        SearchMethod: 'Cone',
                        radius: 300,
                    },
                    {tbl_id: 'bTable'}
            );

            firefly.showTable('tables-1', tblReq1);
            firefly.showTable('tables-1', tblReq2);


            var req = firefly.util.table.makeFileRequest('coveragebug',
                'http://web.ipac.caltech.edu/staff/roby/coverage-bug/emman-not-catalog.tbl',null,
                { pageSize: 100,
                });
            firefly.getViewer().showTable( req, {removable: true, showUnits: false, showFilters: true});





            firefly.showCoverage('coverageHere',
                    {
                        gridOn:true,
                        symbol: {aTable: 'X', bTable: 'arrow'},
                        symbolSize: {aTable: 3, bTable: 12},
                        color: {aTable: 'blue', bTable: 'yellow'},
                        overlayPosition : '149.08;68.739;EQ_J2000',

                        // useHiPS: true,
                        useAllSkyFitsForPlus180 : true,
                        // fovDegFallOver: .02,
                        fovDegFallOver: .5, // 1800 arcsec
                         // hipsSourceURL : 'AllWISE_COLOR',
                        hipsSourceURL : 'http://alasky.u-strasbg.fr/DSS/DSSColor', // url
                        // hipsSourceURL : 'http://alasky.u-strasbg.fr/Planets/CDS_P_Earth_BlueMarble/', // url
                        imageSourceParams: {
                            Service : 'WISE',
                            SurveyKey: '1b',
                            SurveyKeyBand: '1',
                        }
                   });

        };

   }
   
</script>


<script src="http://10.34.1.111:5066/firefly/firefly_loader.js"></script>

</body>
</html>